package com.along.htybrowser;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import com.along.htybrowser.adapter.ResAdapter;
import com.along.htybrowser.bean.ResourcesBean;
import com.along.htybrowser.utils.AutoLog;

import java.util.ArrayList;

/**
 * 重载请求列表
 */
public class ReloadUrlsActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reload_urls);
        RecyclerView resourcesRv = findViewById(R.id.resources_rv);

        ArrayList<ResourcesBean> resList = getIntent().getParcelableArrayListExtra("resList");
        AutoLog.v("重载页面传值：" + resList);
        ResAdapter resAdapter = new ResAdapter(resList);

        LinearLayoutManager manager = new LinearLayoutManager(this, RecyclerView.VERTICAL, false);
        resourcesRv.setLayoutManager(manager);
        resourcesRv.addItemDecoration(new DividerItemDecoration(this, 1));//分割线
        resourcesRv.setAdapter(resAdapter);
    }
}